/**
 */
package mvc_generator.mVCGenerator.impl;

import mvc_generator.mVCGenerator.MVCGeneratorPackage;
import mvc_generator.mVCGenerator.PrimitiveExpression;
import mvc_generator.mVCGenerator.TableRaw;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Table Raw</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link mvc_generator.mVCGenerator.impl.TableRawImpl#getType <em>Type</em>}</li>
 *   <li>{@link mvc_generator.mVCGenerator.impl.TableRawImpl#getRawName <em>Raw Name</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class TableRawImpl extends MinimalEObjectImpl.Container implements TableRaw
{
  /**
   * The cached value of the '{@link #getType() <em>Type</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getType()
   * @generated
   * @ordered
   */
  protected PrimitiveExpression type;

  /**
   * The default value of the '{@link #getRawName() <em>Raw Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getRawName()
   * @generated
   * @ordered
   */
  protected static final String RAW_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getRawName() <em>Raw Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getRawName()
   * @generated
   * @ordered
   */
  protected String rawName = RAW_NAME_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected TableRawImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return MVCGeneratorPackage.Literals.TABLE_RAW;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public PrimitiveExpression getType()
  {
    if (type != null && type.eIsProxy())
    {
      InternalEObject oldType = (InternalEObject)type;
      type = (PrimitiveExpression)eResolveProxy(oldType);
      if (type != oldType)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MVCGeneratorPackage.TABLE_RAW__TYPE, oldType, type));
      }
    }
    return type;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public PrimitiveExpression basicGetType()
  {
    return type;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setType(PrimitiveExpression newType)
  {
    PrimitiveExpression oldType = type;
    type = newType;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MVCGeneratorPackage.TABLE_RAW__TYPE, oldType, type));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getRawName()
  {
    return rawName;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setRawName(String newRawName)
  {
    String oldRawName = rawName;
    rawName = newRawName;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MVCGeneratorPackage.TABLE_RAW__RAW_NAME, oldRawName, rawName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case MVCGeneratorPackage.TABLE_RAW__TYPE:
        if (resolve) return getType();
        return basicGetType();
      case MVCGeneratorPackage.TABLE_RAW__RAW_NAME:
        return getRawName();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case MVCGeneratorPackage.TABLE_RAW__TYPE:
        setType((PrimitiveExpression)newValue);
        return;
      case MVCGeneratorPackage.TABLE_RAW__RAW_NAME:
        setRawName((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case MVCGeneratorPackage.TABLE_RAW__TYPE:
        setType((PrimitiveExpression)null);
        return;
      case MVCGeneratorPackage.TABLE_RAW__RAW_NAME:
        setRawName(RAW_NAME_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case MVCGeneratorPackage.TABLE_RAW__TYPE:
        return type != null;
      case MVCGeneratorPackage.TABLE_RAW__RAW_NAME:
        return RAW_NAME_EDEFAULT == null ? rawName != null : !RAW_NAME_EDEFAULT.equals(rawName);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (rawName: ");
    result.append(rawName);
    result.append(')');
    return result.toString();
  }

} //TableRawImpl
